package com.bw.ppjokeplay.Bind

import androidx.databinding.BindingAdapter
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.bw.ppjokeplay.adapter.CommentsAdapter
import com.chad.library.adapter.base.BaseQuickAdapter

/**
 * @author Lishaohe
 * @description:
 * @date :2021/11/11 0011 下午 7:38
 *
 */
class CommentBind {
    companion object{
        @JvmStatic
        @BindingAdapter(value = ["Adapter"])
        fun bindAdapter(
            recyclerView: RecyclerView,
            commentsAdapter:  BaseQuickAdapter<*, *>
        ){
            val linearLayoutManager = LinearLayoutManager(recyclerView.context)
            linearLayoutManager.orientation = LinearLayoutManager.VERTICAL
            recyclerView.layoutManager = linearLayoutManager
            recyclerView.adapter = commentsAdapter
        }
    }
}